PGetObjectLoc(short cHandle);
Handle you want to locate:Side handles:
kEdgeLeft (these are defined in PKeywords.h)Center of object:
kEdgeRight
kEdgeTop
kEdgeBottomkEdgeCenterCorner handles:kEdgeLeftTop
leftBottom
kEdgeRightTop
kEdgeRightBottom
long xValue;
Location of handle relative to the zero point of the horizontal ruler
long yValue;
Location of handle relative to the zero point of the vertical rulerSelect only one object. The query returns the location of a single object. If multiple objects are selected, PageMaker returns an error.
cHandle for transformed objects. If the selected object was skewed, rotated, or reflected, cHandle should correspond to the handle before the object was transformed. For example, leftTop always refers to the original left-top handle of an object, not the handle that is currently the left-most top handle.
Working with lines. To get the location of a line, the only valid values for cHandle are:
kEdgeCenter for the midpoint of the line
kEdgeLeftTop for the starting point of the line
kEdgeRightBottom for the end point of the line
Example. This example creates a box and queries for the location of the left-top and right-bottom handles. It then rotates the box and queries for the new locations of the same handles. (Remember: y coordinates in PageMaker are positive when moving down from the zero point and negative moving up from the zero point.)
PNew();
// expected reply:-1,-1
PBox(1, 1, -1, -1);
PGetObjectLoc(kEdgeLeftTop);
// expected reply: 1,1
PGetObjectLoc(kEdgeRightBottom);
// rotate 45 degrees
PRotate(kEdgeCenter, 450);
// expected reply: -1.414,0
PGetObjectLoc(kEdgeLeftTop);
//expected reply: 1.415,0
PGetObjectLoc(kEdgeRightBottom);
Comments or suggestions? Contact Adobe Developer Support